﻿using System.Collections.Generic;

namespace CssCommonLibrary
{
    internal class CssStack : Stack<string>
    {
        private const string commentStart = @"/*";
        private const string commentEnd = @"*/";
        private const string paranthesisStart = @"{";
        private const string paranthesisEnd = @"}";

        public bool IsEmpty
        {
            get { return this.Count <= 0; }
        }

        public bool HasParanthesis
        {
            get
            {
                return !IsEmpty && this.Peek() == paranthesisStart;
            }
        }

        public bool HasComment
        {
            get
            {
                return !IsEmpty && this.Peek() == commentStart;
            }
        }

        public void PushComment()
        {
            this.Push(commentStart);
        }

        public void PushParanthesis()
        {
            this.Push(paranthesisStart);
        }
    }
}
